﻿using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Collections.Generic;
using Ccit.Utils;
using Ccit.OA.MsGroup;
 

namespace Ccit.OA.Group
{
    public class GroupBLL
    {
        private IGroup iGroup = null;
        public GroupBLL()
        {
            iGroup = (IGroup)Factory.CreateObject("Ccit.OA.Group.dll", "Ccit.OA.Group.Group",
                                                ImportComponentType.DotNetDll, null);
        }
        #region 获取分组信息tree
        /// <summary>
        /// 获取分组信息tree
        /// </summary>
        /// <returns></returns>
        public string GetGroupMes(string Query)
        {
            string sXml = iGroup.GetGroupMes(Query);
            iGroup = null;
            return sXml;
        }
         /// <summary>
        /// 保存分组信息
        /// </summary>
        /// <returns></returns>
        public List<string> DoSaveGroupMes(MsGroupMes ms)
        {
            List<string> lstResult = iGroup.DoSaveGroupMes(ms);
            iGroup = null;
            return lstResult;
        }
        /// <summary>
        /// 获取编辑页面信息
        /// </summary>
        /// <param name="sRecId"></param>
        /// <returns></returns>
        public MsGroupMes GetGroupMesInfo(string sRecId)
        {
            MsGroupMes ms = iGroup.GetGroupMesInfo(sRecId);
            iGroup = null;
            return ms;
        }
        /// <summary>
        /// 删除分组信息
        /// </summary>
        /// <param name="sRecId"></param>
        /// <param name="type"></param>
        /// <returns></returns>
        public List<string> DoOperate(string sRecId, string UserId, string type)
        {
            List<string> lstResult = iGroup.DoOperate(sRecId, UserId,type);
            iGroup = null;
            return lstResult;
        }
         /// <summary>
        /// 保存分组详细信息
        /// </summary>
        /// <param name="ms"></param>
        /// <returns></returns>
        public List<string> DoSaveDetail(MsGroupDetail ms)
        {
            List<string> lstResult = iGroup.DoSaveDetail(ms);
            iGroup = null;
            return lstResult;
        }
        /// <summary>
        /// 获取分组明细
        /// </summary>
        /// <param name="GroupId"></param>
        /// <returns></returns>
        public DataSet GetGroupDetailMes(string GroupId)
        {
            DataSet dSet = iGroup.GetGroupDetailMes(GroupId);
            iGroup = null;
            return dSet;
        }
        #endregion
    }
}
